<?php

$url_in = array(
'/(?<!\/)href="annonce_detail.php\?annonce=([0-9]+)/',
);

$url_out = array(
"href=\"annonce-\\1.html",
);
$buffer = preg_replace($url_in, $url_out, $buffer);
$buffer = str_replace('href="annonce.php"','href="annonce.html"',$buffer);
$buffer = str_replace('href="contact.php"','href="contact.html"',$buffer);
$buffer = str_replace('href="agence.php"','href="agence.html"',$buffer);
$buffer = str_replace('href="index.php"','href="index.html"',$buffer);
# Type de bien
$buffer = str_replace('href="annonce.php?type=1"','href="annonce-maison.html"',$buffer);
$buffer = str_replace('href="annonce.php?type=2"','href="annonce-appartement.html"',$buffer);
$buffer = str_replace('href="annonce.php?type=3"','href="annonce-terrain.html"',$buffer);
$buffer = str_replace('href="annonce.php?type=4"','href="annonce-location.html"',$buffer);
$buffer = str_replace('href="annonce.php?type=5"','href="annonce-commerce.html"',$buffer);
$buffer = str_replace('href="annonce.php?type=99"','href="annonce-autre.html"',$buffer);
?>